home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / patches / hsmoda07 / hsm_doku / drvin.eng < prev    next >
Text File  |  1994-12-30  |  8KB  |  204 lines

  1. DRVIN.PRG
  2. =========
  3.  
  4. (I have no time for typing everything in the long form. When somebody
  5. wants to write a driver for different hardware or so, he may contact me.
  6. In the future here will appear the complete documentation of the
  7. functions.)
  8.  
  9.  
  10. This program (DRVIN) supports loadable device driver. It has to be loaded
  11. before the drivers. DRVIN and drivers must be executed before the programs
  12. using this drivers. This program should be placed into the AUTO-folder
  13. (for specialists: or an equivalent program collection place). It can be
  14. startet from the desktop too for test purposes.
  15.  
  16.  
  17. TOS
  18. ---
  19. DRVIN works with all TOS versions I know.
  20.  
  21. Mag!X, MagiC
  22. ------------
  23. DRVIN runs under Mag!X from version 2.00 up. It should be run under older 
  24. Mag!X versions too, but this isn't tested. With MagiC >2.00 some functions 
  25. of DRVIN are no longer needed and not used. It will exist a MagiC, 
  26. probably MagiC3, in the future which contains all functions of DRVIN. In 
  27. this case DRVIN is not necessary and the drivers will be startet without 
  28. DRVIN.
  29.  
  30. MiNT
  31. ----
  32. If DRVIN and the drivers are started before MiNT only a little of the 
  33. functions will remain. That's why DRVIN and the drivers should be started 
  34. after MiNT. In this case all functions are realized as under TOS, but no 
  35. more. Redirections and sleep and other plays are impossible with this file 
  36. handles. I don't know whether the AUX-device switching for the aktual 
  37. process will continuosly work. I use neither MiNT nor MultiTOS. As long as 
  38. no MiNT freak is to be found who takes over the adaption and support, no 
  39. special versions for MiNT will exist.
  40.  
  41.  
  42. Configuration
  43. -------------
  44. The configuration is done by using SETTER.TTP.. See SETTER.TXT for use.
  45.  
  46. Because the explainations in the drivers are German I added an
  47. abbreviation.
  48.  
  49. FASTINT:
  50. DRVIN.PRG is able to modify the timer interrupt of the TOS to achieve 
  51. 57600Bd on MODEM1 on a 8MHz-68000. Even on MegaSTE, TT and Falcon the 
  52. modification can provide some enhancements. Under MagiC the madification 
  53. will never be done because MagiC (version 2.0 and newer) has already a 
  54. "friendly" timer routine. FASTINT should be switched off for 
  55. experiments with other operating systems or if mystic errors/behavior 
  56. occur.
  57.  
  58. Function (for interested users):
  59. I discovered it's enough to call the routine (GEMDOS-timer) in NEXT_TIM
  60. (negatvie LineA variable) with an IPL < 6 to enable 57k6Bd receive with an
  61. 68000/8MHz. So I insert a piece of code to set the IPL down to 5. That's not
  62. without any risk but only creates problems when other programs do such hacks
  63. too.
  64.  
  65. EXOPEN:
  66. (works only if the GEMDOS-part of DRVIN is used, not under Magic 
  67. version3.)
  68. "Yes" activates a very restricted GEMDOS-Fopen. It becomes impossible to 
  69. Fopen a device more than ones at a the same time. It may protect (open) 
  70. devices against influences of other programs on the GEMDOS-level. Normally 
  71. you should answer "No", because some programs don't expect an error code 
  72. from Fopen (reactions from senseless displayings till crashes) and because 
  73. the program termination (normal and abnormal = crash) isn't watched, that 
  74. means if the program doesn't close a device it remains open! (In few 
  75. words: It's a game for developers.)
  76.  
  77.  
  78. Construction
  79. ------------
  80. DRVIN consist of three import parts: making the RSVF-cookie, new Bconmap-
  81. and MAPTAB-manager for BIOS and XBIOS, basic routines for installation of
  82. simple Mag!X compatible devices drivers.
  83.  
  84.  
  85. RSVF-Cookie
  86. -----------
  87. A RSVF-cookie is created which value points to two 0-LONGs, representing
  88. an end-object. So devices drivers aren't in need of creating a cookie.
  89. They hook themselves only in the RSVF-lists. The RSVF-cookie provides a
  90. structure for providing the basic information about interfaces. The
  91. description is contained in the file RSVF_COO.TXT.
  92.  
  93.  
  94. MAPTAB-Verwaltung
  95. -----------------
  96. This part hooks in the BIOS- and XBIOS-trap and manages the
  97. XBIOS-functions Bconmap, Rsconf and Iorec(for AUX). The BIOS-functions
  98. Bconstat, Bconin, Bcostat and Bconout for device AUX and all devices from
  99. included 6 up are managed. Bconmap and a MAPTAB are provided under every
  100. TOS-version. The routines of the actual setted device by bconmap are
  101. copied in the xco*-vectors (except TOS1.00) too, but not used there. Two
  102. new Bconmap-subfunctions with the opcodes -400 and -401 are provided for
  103. overwriting a MAPTAB-entry and for adding a new entry.
  104.  
  105. The length of the MAPTAB is no longer limited. ## The actual limit in this
  106. DRVIN is 10 entry, but this is only a constant in the source, easy to
  107. change and extend.
  108.  
  109.  
  110. GEMDOS-part
  111. -----------
  112. It looks like the old HSMODEM1-version from outside and from inside like
  113. (### at the moment) a reduced Mag!X-beta. Fopen, Fread, Fwrite, Fcntl are
  114. directed to the driver, but all with fileptr == NULL.
  115.  
  116.  
  117. Actions
  118. -------
  119. When DRVIN is started under TOS>2.00 oder Mag!X>2.00, all old routines
  120. from the old MAPTAB are copied in the new one, so that the
  121. (X)BIOS-functions will work with the old routines if no driver is
  122. installed. Under TOS1.00 it looks very bad, the MFP-driver must be loaded,
  123. otherwise serialI/O will not work (only the IOREC-pointer is copied).
  124. Under 1.00<TOS<2.00 will it work a litte without drivers because only
  125. Rsconf is not copied, that's why the MFP-driver must be loaded.
  126.  
  127.  
  128. Mag!X- (and DRVIN-) friendly Bco*-routines
  129. ------------------------------------------
  130. modificable registers A0-A2/D0-D2 (for Rsconf too)
  131. Bconout has to start with the instruction
  132.  lea 6(sp),a0
  133. and will be called mostly after this (startadr+4) with the pointer to 
  134. parameter (WORD) in A0.
  135.  
  136.  
  137. New XBIOS-Bconmap-functions (-400, -401)
  138. ----------------------------------------
  139. These functions may only be used to install Mag!X-friendly functions.
  140.  
  141. In the MAPTAP there is room for more than 4 devices. The provider of the
  142. XBIOS-functions (DRVIN or a future Mag!X) provides enough room to install
  143. additional devices. It may create the room dynamically or have a fast
  144. upper limit. Never the less a driver could get an error message caused by
  145. insufficent memory or other reasons.
  146.  
  147. The XBIOS-function Bconmap is extended by two new subfunctions. If the
  148. extensions are unavailable, the caller gets a 0 as error message.
  149.  
  150. LONG Bconmap((WORD)-400, (WORD) dev_nr, (LONG) ptr_to_6_longs) dev_nr is a
  151. device number from 6 up which is already exists in the MAPTAB, otherwise
  152. the error code -15 EUNDEV is returned. ptr_t_6_longs points to a structure
  153. equal to a MAPTAB-entry. This structure is copied to te according
  154. MAPTAB-place. If the new installed device is the actual AUX-device, the
  155. routines are copied to xco* and the actual rsconf and iorec cells to. This
  156. function is only for installing Mag!X-friendly routines. The device number
  157. is returned as a success message, that is, the dev_nr is return value too.
  158.  
  159. LONG Bconmap((WORD)-401, (LONG) ptr_to_6_longs)
  160. similar -400, but adds a device to the MAPTAB. Return message is either
  161. the device number selected by this function or the error code -12 EGENRL
  162. if it's impossible to enlarge the MAPTAB. This function will never
  163. transfer the vectors to xco* because a added device can't be the actual in
  164. the moment of adding.
  165.  
  166.  
  167. Driver
  168. ------
  169. DRVIN doesn't provides all possibilities of the Mag!X(beta)-versions. Who
  170. wants to write a driver running under DRVIN too, could contact me for
  171. details.
  172.  
  173.  
  174. Versions
  175. --------
  176. 1993-11-23
  177. GEMDOS-trap modifies only A0/D0 as adaption to very unclean programs
  178. Fopen and Fclose directed to the drivers
  179. 1993-11-28
  180. Bug under TOS1.00 in Bconmap removed
  181. own environment string _PNAM=DRVIN.PRG
  182. 1994-06-17
  183. Pointer array for Dcntl M_DEV_INSTALL has changed to the format of MagiC
  184. version 3 (ex Mag!X). INKOMPATIBLE to earlier versions of DRVIN and
  185. Drivers.
  186. 1994-08-13
  187. Only pointer to the driver block is stored during Dcntl M_DEV_INSTALL as
  188. Magic does (not the block itself). Space available for 16 GEMDOS devices.
  189. 1994-08-18
  190. FASTINT configuration moved from MFP* to here
  191. 1994-08-25
  192. internal change
  193. 1994-10-12
  194. EXOPEN option
  195. 1994-10-29
  196. Changes in Dcntl, Fdelete added. Deleting an re-installing drivers should 
  197. work as in MagiC3. FASTINT automatically off under MagiC.
  198. 1994-12-30
  199. fast Bconout parameter passing changed -> new MAPT_APP/MAPT_OVE function 
  200. numbers
  201.  
  202. Harun Scheutzow, Nov. 21st 1993 and later
  203. (Harun_Scheutzow@B.maus.de)
  204. ---EOF---